<template>
	<view class="main" :style="{paddingBottom:(getSafeBottom )+'px'}">
		<navbar :title="cataName" :isFixed="false" transparent></navbar>
		<view class="content" :style="{paddingTop:(0 ) + 'px'}">
			<rich-text :nodes="detail.cnt"></rich-text>
		</view>
		<view class="main-bj">
			
		</view>
	</view>
</template>

<script>
	import Navbar from '@/components/Navbar.vue'
	import { mapGetters } from 'vuex'
	import {getContentOne} from "@/core/web-api/common.js"
	export default{
		components:{
			Navbar
		},
		data(){
			return{
				detail:{},
				cataName:""
			}
		},
		methods:{
			/**
			 * 获取详情
			 */
			getDetail(){
				getContentOne({
					cataname:this.cataName
				}).then(res=>{
					if(res.code==20000){
						this.detail = res.data.detail
						if(this.detail.cnt){
							this.detail.cnt = this.detail.cnt.replace("<img","<img style='max-width:100%;'")
						}
					}
				})
			},
		},
		computed:{
			...mapGetters(['getStateHeight','getNavbar','getSafeBottom'])
		},
		onLoad(options) {
			this.cataName = options.cataName;
			this.getDetail();
		}
	}
</script>
<style>
	page{
		background-color: #fff!important;
	}
</style>
<style scoped lang="less">
	.main {
		width: 100%;
	
	// 	&-bj {
	// 		width: 100%;
	// 		height: 50vh;
	// 		position: fixed;
	// 		left: 0;
	// 		top: 0;
	// 		z-index: -1;
	// 		background: linear-gradient(to bottom, #bdccfb, #f5f5f5);
	// 	}
	
	}
	
	.content {
		width: 100%;
		margin-top: 30upx;
		padding: 0 30upx;
		box-sizing: border-box;
	}
	.content img{
		width: 100%;
	}
</style>